window.onload=function(){
      var submenu=$(".submenu li");
    submenu.click(function(){
        $("#could_web").show();

    });

    


var set_head=$(".set_head>ul>li");
var set_head1=$(".set_head1>ul>li");
var set_head4=$(".case_head>.set_head4");
var news_head=$(".news_head>ul>li");
var scren=$(".screens_head>ul>li");
var set2=$(".set2");
var set=$(".set1");
var set4=$(".set4");
var set5=$(".set5");
var set15=$(".set15");

for(var i=0;i<set_head.length;i++){
    set_head[i].index=i;
    set_head[i].onclick=function()
    {

        for(var i=0;i<set_head.length;i++){
            set_head[i].className='';
            set[i].style.display='none';

        }
        this.className='btn_color';
         set[this.index].style.display='block';
     }
 }

for( var i=0;i<set_head1.length;i++){
    set_head1[i].index=i;
    set_head1[i].onclick=function(){
        for(var i=0;i<set_head1.length;i++){
            set_head1[i].className='';
            set2[i].style.display="none";
        }
        this.className='btn_color';
        set2[this.index].style.display='block';
        }
    }

    for( var i=0;i<set_head4.length;i++){
    set_head4[i].index=i;
    set_head4[i].onclick=function(){
        for(var i=0;i<set_head4.length;i++){
            set_head4[i].className='';
            set4[i].style.display="none";
        }
        this.className='btn_color';
        set4[this.index].style.display='block';
        }
    }

     for( var i=0;i<news_head.length;i++){
    news_head[i].index=i;
    news_head[i].onclick=function(){
        for(var i=0;i<set_head4.length;i++){
            news_head[i].className='';
            set15[i].style.display="none";
        }
        this.className='btn_color';
        set15[this.index].style.display='block';
        }
    }
/*三屏主站按钮切换*/
 for( var i=0;i<scren.length;i++){
    scren[i].index=i;
    scren[i].onclick=function(){
        for(var i=0;i<scren.length;i++){
            scren[i].className='';
            set5[i].style.display="none";
        }
        this.className='screen_color';
        set5[this.index].style.display='block';
        }
    }
/*二维码生成*/
    var generation_head=$(".generation_head ul li");
    var card1=$(".card1");
    for(var i=0;i<generation_head.length;i++){
        generation_head[i].index=i;
        generation_head[i].onclick=function(){
            for(var i=0;i<generation_head.length;i++){
                generation_head[i].className='';
                card1[i].style.display='none';
            }
            this.className='cord_color';
            card1[this.index].style.display='block';
        }
    }


/*添加代码所有产品*/
var titl=$(".Increase_input>ul>li:eq(1)>input")
var increse_select=$("#increase_select");
var file_picture=$(".picture_file input")
var seque=$(".Increase_input>ul>li:eq(5)>input")
$("#incra_btn").click(function(){
    var tr="<tr><td><input type=\"checkbox\" name=\"check\"/>"+"</td><td>"+titl.val()+"</td><td>"+increse_select.val()+"</td><td><p>"+file_picture.val()+"</p></td><td>"+seque.val()+"</td></tr>";
    $("#pro_table").append(tr);
});
$("#pro_dele").click(function(){
    var check=document.getElementsByName("check");
    for(var i=0;i<check.length;i++){
        if (check[i].checked==true) {
            document.getElementById("pro_table").deleteRow(i);
           i--;
        }
    }
});

/*广告设置案例*/
var adver_picture=$(".adver_input ul li:eq(0)>input");
var adver_add=$(".adver_input ul li:eq(1)>input");
var ti=$(".adver_input ul li:eq(2)>input");
var adver_btn=$(".adver_input ul li:eq(3)>input");
var adver_tabl_a=$("#adver_tabl .adver_a");
adver_btn.click(function(){
	var adver_tr="<tr><td><p>"+adver_picture.val()+"</p></td><td>"+adver_add.val()+"</td><td>"+ti.val()+"</td><td><a class=\"adver_a\" href='#'>删除</a></td></tr>";
	$("#adver_tabl").append(adver_tr);

});

/*产品设置分类管理页面*/
 var Increase_txt=$(".Increase .Increase_input li:eq(0) input");
 var  Increase_paixu=$(".Increase .Increase_input li:eq(1) input");
 var Increase_tijiao=$(".Increase_input .product_button");
 Increase_tijiao.click(function(){
 	var Increase_tr="<tr><td><input type=\"checkbox\" name=\"tijiao_check\"/>"+"</td><td>"+Increase_txt.val()+"</td><td>"+Increase_paixu.val()+"</td></tr>"
 	$("#Incras").append(Increase_tr);
 })
  $("#sort>p>input").click(function(){
 	var tijiao_check=document.getElementsByName("tijiao_check");
 	for(var i=0;i<tijiao_check.length;i++){
 		if(tijiao_check[i].checked==true){
 			document.getElementById("Incras").deleteRow(i);
 			i--;
 		}
 	}
 })

adver_tabl_a.click(function(){
	var tr_a=$(this).parent().parent();
	tr_a.remove();
})


/*产品设置添加分类*/
var fenlei=$(".Increase_input input:eq(0)");
var fenlei_btn=$(".Increase_input .product_button");
fenlei_btn.click(function(){
	var tianjia_option="<option>"+fenlei.val()+"</option>";
	$("#increase_select").append(tianjia_option);
});


/*验证表单不能为空*/


/*qq客服*/
    var choose=$(".qq_muban ul li p");
    for(var i=0;i<choose.length;i++){
        choose[i].onclick=function(){
            for(i=0;i<choose.length;i++){
                choose[i].className='';
            }
           this.className='qq_color';
            
        }

    }
/*qq客服在线弹出框*/
 var depart_btn=$("#department>p>input");
 var popping=$("#popping");
 var close=$("#popping>p>span");
 depart_btn.click(function(){
    if(popping.is(":hidden")){
        popping.show();
    }
})
 close.click(function(){
    popping.hide();
 })


var submit_btn=$(".submit_btn");
for(var i=0;i<submit_btn.length;i++){
	submit_btn[i].onclick=function(){
		alert("保存成功");

	}
} 
    
}



       
